using System;
using System.Collections.Generic;
using System.Text;
using Spring.Data.Objects;
using Common.Logging;
using Spring.Data.Common;
using Domain.pe.com.workspace;
using System.Collections;

namespace DAO.pe.com.workspace.oficina.impl.procedure
{
    public class RegistrarFacturaDetalleProcedure : StoredProcedure
    {
        private static ILog logger = LogManager.GetLogger(typeof(RegistrarFacturaDetalleProcedure));
      
        public RegistrarFacturaDetalleProcedure(IDbProvider dbProvider, string procedureName)
            : base(dbProvider, procedureName)
        {    
            DeriveParameters();            
            Compile();
        }
        
        public virtual void ejecutar(DetalleFactura detalleFactura)
        {
            logger.Debug("iniciando ejecucion de procedure");          
            object[] inParameterValues = new object[4];
            inParameterValues[0] = detalleFactura.Id;
            inParameterValues[1] = detalleFactura.IdFactura;
            inParameterValues[2] = detalleFactura.Cantidad;
            inParameterValues[3] = detalleFactura.Precion;
            Query(inParameterValues);
            logger.Debug("terminando ejecucion de procedure para insertar detalle con id" + detalleFactura.Id);
          
        }
    }
}
